package com.ghsc.ghxc.jsb.ui.live.view

import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.cn.appcore.ext.setSingleClickListener
import com.ghsc.ghxc.jsb.R
import com.ghsc.ghxc.jsb.ui.live.shopping.LiveAudienceFragment
import com.ghsc.ghxc.jsb.ui.live.shopping.LiveCarFragment
import com.lxj.xpopup.core.BottomPopupView

/**
 * 项目：GuoHuaJsb
 * 包名：com.ghsc.ghxc.jsb.ui.live.view
 * 类名：LiveCartListAudiencePopupView
 * 创建时间：2024/6/17 14:52
 * 创建人 @author： xiaolin
 * 描述 ：Todo...直播间小黄车  观众端
 */
class LiveCartListAudiencePopupView  (context: AppCompatActivity, anchorId:String, liveId:String) : BottomPopupView(context) {
    //    override fun getImplLayoutId() = R.layout.live_cart_list
    override fun getImplLayoutId() = R.layout.live_cart_list
    private val mContext = context
    private val anchorId = anchorId
    private  val liveId=liveId

    override fun onCreate() {
        super.onCreate()
        val activity = mContext as AppCompatActivity
        val beginTransaction = activity.supportFragmentManager.beginTransaction()
        val giftFragment = LiveAudienceFragment.newInstance(anchorId,liveId)
        beginTransaction.add(R.id.flContainer,giftFragment)
        beginTransaction.commit()

        findViewById<TextView>(R.id.tvBtnCancel).setSingleClickListener {
            dismiss()
        }
        findViewById<TextView>(R.id.tvColse).setOnClickListener {
            dismiss()
        }
    }
    override fun getInternalFragmentNames(): MutableList<String> {
        val list = mutableListOf<String>()
        list.add(LiveCarFragment::class.java.simpleName)
        return list
    }
    override fun getMaxWidth() = 0

}